package com.runachina.util;

import android.util.Base64;

import java.io.IOException;


public class Base64Util {

	/**
	 * 编码
	 *
	 * @param data
	 * @return
	 * @throws IOException
	 */
	public static String encode(String data){
		String result = Base64.encodeToString(data.getBytes(),1);
		return result;
	}

	/**
	 * 解码
	 *
	 * @param data
	 * @return
	 */
	public static String decode(String data) {
		byte result[] = Base64.decode(data.getBytes(), 1);
		return new String(result);
	}
}
